int sumOddLengthSubarrays(int* arr, int arrSize){
    int sum = 0;
    for(int start = 0; start < arrSize; start++)
    {
        for(int length = 0; length < arrSize; length += 2)
        {
            int end = start + length;
            for(int index = start; index <= end && end < arrSize; index++)
            {
                sum += arr[index];
            }
        }
    }
    return sum;
}